<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

session_start();

class Welcome extends CI_Controller {
    
    public function index(){
        $session_array = $this->session->userdata('logged_in');
        if (!$session_array){
            redirect('login');
        }else{
            $args['title'] = 'LatiSoft';
            $args['content'] = 'welcome_message';

            $args['sideTitle'] = 'Home';
            $args['sideItems'] = array(
                array(  'label' => 'Google',
                        'link' => 'http://google.com.pe'),

                array(  'label' => 'Facebook',
                        'link' => 'http://facebook.com'),

                array(  'label' => 'PUCP',
                        'link' => 'http://pucp.edu.pe')
            );

            $session_data = $this->session->userdata['logged_in'];
            $args['username'] = $session_array['username'];

            $this->load->view('templates/template',$args);
        }
    }
    
}